package com.liuze;

import com.liuze.base.utils.RedisConstants;
import com.liuze.base.utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;

import java.util.HashSet;
import java.util.Set;

@SpringBootApplication
@RestController
public class LiuzeApplication {
    @Autowired
    JedisPool jedisPool;

    public static void main(String[] args) {
        SpringApplication.run(LiuzeApplication.class, args);
    }

    @GetMapping("test")
    public void test() {
        Jedis jedis = null;
        jedis = jedisPool.getResource();
        jedis.select(1);
        jedis.hset("hash", "key", "value");
        jedis.expire("hash", 100);
    }
}